<?php

	/**
	 * File : interface.php
	 * Description : Fonctions liés à l'interface graphique
	 * Date : 07.08.2012 13:05:43
	 * 
	 * This file is part of Phenix.  Phenix is free software: you can
	 * redistribute it and/or modify it under the terms of the GNU General Public
	 * License as published by the Free Software Foundation, version 2.
	 *
	 * This program is distributed in the hope that it will be useful, but WITHOUT
	 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
	 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
	 * details.
	 *
	 * You should have received a copy of the GNU General Public License along with
	 * this program; if not, write to the Free Software Foundation, Inc., 51
	 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
	 *
	 * Nils Schaetti <n.schaetti@gmail.com>
	**/

	/**
	 * Crée le barre d'outil principale
	 * 
	 * @param string $path Chemin des images
	 * @param string $file_path Chemin des fichiers PHP
	 * @return string Code HTML
	 */
	function phenix_MainToolBar($path='',$file_path='')
	{
		// Nouvelle barre de menu
		$menuBar = new ktkMenuBar('phenixMenuBar');
	
		// Ajoute des boutons
		$menuBar->addButton('New job', new ktkMenuBarButton('mbNewJob','New job',BUTTON_TYPE_SEPARATOR,$path.'images/new_job.png',$file_path.'new_job.php'));
		$menuBar->addButton('Running', new ktkMenuBarButton('mbRunning','Running',BUTTON_TYPE_NORMAL,$path.'images/running.png',$file_path.'running.php'));
		$menuBar->addButton('Past Job', new ktkMenuBarButton('mbPastJobs','Past jobs',BUTTON_TYPE_NORMAL,$path.'images/past_jobs.png',$file_path.'past_jobs.php'));
		$menuBar->addButton('Stared', new ktkMenuBarButton('mbStared','Stared',BUTTON_TYPE_SEPARATOR,$path.'images/important_jobs.png',$file_path.'stared.php'));
		$menuBar->addButton('Computers', new ktkMenuBarButton('mbComputers','Computers',BUTTON_TYPE_NORMAL,$path.'images/computers.png',$file_path.'computers.php'));
		$menuBar->addButton('Home', new ktkMenuBarButton('mbHome','Home',BUTTON_TYPE_SEPARATOR,$path.'images/home.png','home.php'));
		$menuBar->addButton('Statistics', new ktkMenuBarButton('mbStatistics','Statistics',BUTTON_TYPE_NORMAL,$path.'images/statistics.png',$file_path.'statistics.php'));
	
		// Envoi le code
		return $menuBar->getCode();
	}
	
	/**
	 * Crée la barre d'entête
	 * 
	 * @param string $path Chemin du répertoire vers les fichiers
	 * @return string Code HTML
	 */
	function phenix_HeaderBar($path='')
	{
		// Nouvelle barre d'entête
		$headerBar = new ktkHeaderBar('phenixHeaderBar');
		
		// Hauteur
		$headerBar->setHeight(22);
		
		// Ajoute des boutons
		$headerBar->addButton('Help', new ktkHeaderBarButton('hbHelp','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_IMAGE,$path.'../images/help.png','help.php',22));
		$headerBar->addButton('Web', new ktkHeaderBarButton('hbWeb','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Web',$path.'../Web/index.php',11.5));
		$headerBar->addButton('Galley', new ktkHeaderBarButton('hbGallery','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Gallery',$path.'../Gallery/index.php',11.5));
		$headerBar->addButton('Store', new ktkHeaderBarButton('hbStore','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Store',$path.'../Store/index.php',11.5));
		$headerBar->addButton('People', new ktkHeaderBarButton('hbPeople','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'People',$path.'../People/index.php',11.5));
		$headerBar->addButton('Mail', new ktkHeaderBarButton('hbMail','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Mail',$path.'../Mail/index.php',11.5));
		$headerBar->addButton('Forms', new ktkHeaderBarButton('hbForms','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Forms','../Forms/index.php',11.5));
		$headerBar->addButton('Stats', new ktkHeaderBarButton('hbStats','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Stats','../Stats/index.php',11.5));
		$headerBar->addButton('Share', new ktkHeaderBarButton('hbShare','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Share','../Share/index.php',11.5));
		$headerBar->addButton('DataCrush', new ktkHeaderBarButton('hbDataCrush','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'DataCrush','../DataCrush/index.php',11.5));
		$headerBar->addButton('Phenix', new ktkHeaderBarButton('hbPhenix','#fff',BUTTON_POSITION_LEFT,BUTTON_TYPE_TEXT,'Phenix','../Phenix/index.php',11.5));
		$headerBar->addButton('Quit', new ktkHeaderBarButton('hbQuit','#fff',BUTTON_POSITION_RIGHT,BUTTON_TYPE_IMAGE,'../images/log-out.png',$path.'../logout.php',22));
		$headerBar->addButton('Settings', new ktkHeaderBarButton('hbSettings','#fff',BUTTON_POSITION_RIGHT,BUTTON_TYPE_IMAGE,'../images/settings.png',$path.'../settings.php',22));
		
		// Envoi le code
		return $headerBar->getCode();
	}

?>
